package vip.finance.makemoney.service;

import com.baomidou.mybatisplus.extension.service.IService;
import vip.finance.makemoney.common.ScheduleEnum;
import vip.finance.makemoney.common.vo.ScheduleVo;
import vip.finance.makemoney.config.annotation.DoSchedule;
import vip.finance.makemoney.entity.Schedule;

import java.util.List;

/**
 * @author yangbin
 * @since 2023-02-09
 */
public interface ScheduleService extends IService<Schedule> {

    /**
     * 调度列表
     */
    List<ScheduleVo> scheduleList();

    /**
     * 执行调度
     */
    void runSchedule(Integer scheduleId, String args);

    /**
     * 更新股票库
     *
     * @param args "CN", "HK", "US"
     */
    @DoSchedule(value = ScheduleEnum.SYNC_ALL_STOCK)
    void syncAllStock(Integer scheduleLogId, String args);

    /**
     * 更新ETF库
     */
    @DoSchedule(value = ScheduleEnum.SYNC_ALL_ETF)
    void syncAllETF(Integer scheduleLogId, String args);

    /**
     * 更新ETF持仓
     */
    @DoSchedule(value = ScheduleEnum.SYNC_ALL_ETF_STOCK)
    void syncAllETFStock(Integer scheduleLogId, String args);

    /**
     * 刷新行情
     */
    void refreshUserStockBySnow(String... markets);

    /**
     * 刷新所有行情
     */
    void refreshAllStockBySnow(String... markets);

    /**
     * 刷新stock_hk_us
     */
    @DoSchedule(value = ScheduleEnum.REFRESH_HK_US)
    void refreshHKUS(Integer scheduleLogId,String args);

    void refreshZhiShu();
}
